package com.team8.common.results;


public class Result {

    private String message;
    private String url;
    private int statusCode;
    private String data;

    public Result(){

    }

    public Result(String message) {
        this.message = message;
    }

    public Result(int statusCode, String data) {
        this.statusCode = statusCode;
        this.data = data;
    }

    public Result(String message, String url, int statusCode, String data) {
        this.message = message;
        this.url = url;
        this.statusCode = statusCode;
        this.data = data;
    }

    public Result(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return "Result{" +
                "message='" + message + '\'' +
                ", url='" + url + '\'' +
                ", statusCode=" + statusCode +
                ", data='" + data + '\'' +
                '}';
    }

    private static final Result ErrorResult;
    private static final Result SuccessResult;
    static {
        ErrorResult = new Result();
        ErrorResult.setStatusCode(500);


        SuccessResult = new Result();
        SuccessResult.setStatusCode(200);
    }


    public static Result getErrorInstance(){
        return ErrorResult;
    }
    public static Result getSuccessInstance(){
        return SuccessResult;
    }

}
